package com.example.ui.other;

import com.example.huashangapp.R;
import com.example.ui.IndexActivity;
import com.example.ui.LoginActivity;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class AboutOurActivity extends Activity {
	private Button leftBtn;
	private TextView titleText;
	private TextView aoa_help,aoa_update,aoa_web;
	private Intent aoa_i;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.other_about_out);
		init();

	}

	private void init() {
		leftBtn = (Button) findViewById(R.id.about_title_left_btn);
		titleText = (TextView) findViewById(R.id.about_title_middle_text);
		leftBtn.setText("返回");
		
		aoa_help=(TextView) findViewById(R.id.about_help_text);
		aoa_update=(TextView) findViewById(R.id.about_upgrade_text);
		aoa_web=(TextView) findViewById(R.id.about_official_web_text);
		aoa_help.setOnClickListener(aoa_ocl);
		aoa_update.setOnClickListener(aoa_ocl);
		aoa_web.setOnClickListener(aoa_ocl);
		leftBtn.setOnClickListener(aoa_ocl);
	}
  private OnClickListener aoa_ocl=new OnClickListener() {
	
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.about_title_left_btn:
			Intent i = new Intent();
			i.setClass(AboutOurActivity.this, IndexActivity.class);
			startActivity(i);
			IndexActivity.isLogin = true;
			finish();
			break;
		case R.id.about_help_text:
			aoa_i=new Intent();
			aoa_i.setClass(AboutOurActivity.this, FAQActivity.class);
			startActivity(aoa_i);			
			break;
		case R.id.about_upgrade_text:
			Toast.makeText(AboutOurActivity.this, "当前已经是最新版本", Toast.LENGTH_SHORT).show();
			break;
		case R.id.about_official_web_text:
			Intent web=new Intent(Intent.ACTION_VIEW,Uri.parse("http://hsxxw.cn/"));
			startActivity(web);
			break;

		default:
			break;
		}
	}
};
	

}
